package edu.gd.mvndemo;

import edu.gd.dao.UserDao;
import edu.gd.entity.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/reset_pwd")
public class ResetPwdServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String user=req.getParameter("name");
        String password=req.getParameter("password");
        Insert.update(user,password);
        resp.sendRedirect(req.getContextPath() + "/login.jsp");
    }
}
